<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * Class RunGameSeason
 * @package App
 */
class RunGameSeason extends Model
{
    public $timestamps = false;
    protected $table = "run_game_season";

    /**
     * 当前赛季ID
     * @return mixed
     */
    static function ThisSeason()
    {
        $time = time();
        $return = RunGameSeason::where('start_at', '<=', $time)->where('end_at', '>=', $time)->value('id');
        if (!$return) {
            return 0;
        }
        return $return;
    }
}
